<extend name="Base:common" />
<block name="body">


<link rel="stylesheet" href="__CSS__/go/index3.css" />
<link rel="stylesheet" type="text/css" href="__CSS__/go/GoodsDetails.css"/>
<link rel="stylesheet" type="text/css" href="__CSS__/go/header.css"/>

<link rel="stylesheet" type="text/css" href="__CSS__/go/cloud-zoom.css"/>
<script type="text/javascript" src="__JS__/yun/cloud-zoom.min.js"></script>

<script type="text/javascript">
$.fn.CloudZoom.defaults = {
    zoomWidth: '400',
    zoomHeight: '400',
    position: 'right',
    tint: false,
    tintOpacity: 0.5,
    lensOpacity: 0.5,
    softFocus: false,
    smoothMove: 7,
    showTitle: false,
    titleOpacity: 0.5,
    adjustX: 0,
    adjustY: 0
};
</script>
<style type="text/css">
.cloud-zoom-big{border:1px solid #ccc;}
</style>
<!--导航-->
<div class="Current_nav">
    <a href="{:U('Home/Yungo/index')}">一元云购</a> <span>&gt;</span> 
    <volist name="goods['cat']" id="vo">
        <a href="{:U('Home/Yungo/index',array('to'=>3,'c1Id'=>$goods['cat']['mall_cateid']['catId']))}">{$vo['catName']}</a><span>&gt;</span> 
    </volist>
    商品详情
    <div class="m-other fr" id="btnMyCart"><a class="goCartList" href="{:U('Home/Yungo/index',array('to'=>1))}" title="云购清单"><em>云购清单</em><span>{$cartNum}</span></a></div>
</div>

<!--期数导航-->
<div class="show_content">
    <div id="divPeriodList" class="show_Period" style="max-height:99px;">   
        <div class="period_Open"><a id="btnOpenPeriod" href="javascript:void(0);" title="更多">更多<i>+</i></a></div>
        <ul class="Period_list">
            <li><a href="{:U('Home/Yungo/index',array('to'=>4,'gid'=>$goods['details']['id']))}"><b class="period_Ongoing period_ArrowCur" style="padding-left:0px;">第{$goods['details']['qishu']}期<i></i></b></a></li>
            <volist name="goods['qishu']" id="vo"> 
                <if condition="$goods['details']['qishu'] neq $vo['qishu']">
                    <li><a href="{:U('Home/Yungo/index',array('to'=>5,'gid'=>$vo['id']))}" class="gray02">第{$vo['qishu']}期</a></li>
                </if>
            </volist>
        </ul>    
    </div>
    <script>
        $(function(){
            $('#divPeriodList ul').each(function(index){
                if(index != 0){
                    $('#divPeriodList ul').eq(index).hide();
                }
            });
        });
        $("#btnOpenPeriod").click(function(){
                var ui_obj = $("#divPeriodList > ul");
                if($(this).attr("click")=='off'){
                    $("#divPeriodList").css("max-height",ui_obj.length*33+"px");    
                    $(this).attr("click","on");
                    $(this).html("收起<s></s>");
                    
                }else{
                    $("#divPeriodList").css("max-height","99px");   
                    $(this).attr("click","off");
                    $(this).html("更多<i></i>");
                }           
        });
    </script>   
</div>


<div class="show_content" style="margin-top:10px;background:#e4e4e4 !important;">
    <div id="divMain" class="ng-main-wrapper">
            <div id="divMainInfo" class="ng-main clearfix">
            <div class="boxs" style="width:970px; float:left;background:#fff;height:500px;">            
            <!--图片展示-->
            <div class="Pro_Detleft">
            <div class="zoom-small-image" style="position:relative;">
                <span href="__ROOT__/{$goods['details']['thumb']}" class = 'cloud-zoom' id='zoom1' rel="adjustX:10, adjustY:-2">
                <img width="80px" height="80px" src="__ROOT__/{$goods['details']['thumb']}" /></span>
                <div class="action_info">第{$goods['details']['qishu']}期正在进行中...</div>
            </div>
            <div class="zoom-left"></div>
            <div class="zoom-right"></div>
            <div class="zoom-desc"> 
                <div class="jcarousel-clip" style="margin-left:40px;width:320px;padding-left:10px;">
                    <p>
                    <volist name="goods['details']['gallery']" id="vo">             
                    <label href="__ROOT__/{$vo['goodsImg']}" class='cloud-zoom-gallery'  rel="useZoom: 'zoom1', smallImage: '__ROOT__/{$vo['goodsImg']}'">
                    <img class="zoom-tiny-image" src="__ROOT__/{$vo['goodsThumbs']}" /></label>  
                    </volist>                                       
                    </p>
                </div>
            </div>
            <script>
                var si=$(".jcarousel-clip label").size();
                $(".zoom-left,.zoom-right").hide();
                var label=si*55;
                $(".jcarousel-clip p").css({width:label,left:"0"});
                if(label > 385){
                    $(".zoom-left,.zoom-right").show();
                }else{
                    $(".zoom-left,.zoom-right").hide();
                }
                $(".zoom-left").click(function(){
                    var le=$(".jcarousel-clip p").css("left");
                    var le2 = le.replace(/px/,"");
                    if(le !='0px' ){
                        $(".jcarousel-clip p").css({left:le2*1+55});
                    }                       
                })
                $(".zoom-right").click(function(){
                    var le=$(".jcarousel-clip p").css("left");
                    var le2=le.replace(/px/,"");
                    var max_next=-(si-7)*55+"px";
                    if(le!=max_next){                       
                        $(".jcarousel-clip p").css({left:le2*1-55});
                    }
                })
            </script>
        </div>
                <!--正在进行中-->
            <div style="margin-left: -100px;" class="ng-goods-detail ng-goods-detail-height">
                <h2 class="o-title"><span class="num">
                    (第{$goods['details']['qishu']}期)</span>{$goods['details']['title']}<span class="o-info"></span>
                </h2>
                <p class="text-left price o-p">价值：{$goods['details']['money']}</p>
                <div class="line-time">

       <div class="line-wrapper u-progress" title="已完成{$goods['details']['scale']}%">
        <span class="pgbar" style="width:{$goods['details']['scale']}%;display:">
            <span class="pging"></span>
        </span>
        </div>
    <div class="text-wrapper clearfix">
            <div class="now-has">
                <span>{$goods['details']['canyurenshu']}</span><p>已参与</p>
            </div>
            <div class="total-has">
                <span id="CodeQuantity">{$goods['details']['zongrenshu']}</span><p>总需人次</p>
            </div>
            <div class="overplus-has">
                <span id="CodeLift">{$goods['details']['shenyurenshu']}</span><p>剩余</p>
            </div>
    </div>
</div>
                        
<div class="my-buy clearfix">
    <p class="mine">我要夺宝</p>
    <div id="divNumber" class="option-wrapper clearfix">
        <a href="javascript:;" class="mius"id="shopsub">-</a>
        <input class="input-num" value="1" type="text" onKeyUp="value=value.replace(/\D/g,'')" id="num_dig">
        <a href="javascript:;" class="add" id="shopadd">+</a>
    </div>
    
    <!--<ul class="check-num clearfix"><li onclick="add10();">10</li><li onclick="add50();">50</li><li onclick="add100();">100</li><li onclick="add200();">200</li></ul>-->
    <ul class="check-num clearfix"></ul>
    <p class="fl">人次</p>
    <span class="totip">加大参与人次，夺宝在望</span>
    <div class="mine-prob" style="display:none;"><i></i></div>
    <span id="span_tip"></span>
</div>

<div style="display:none;" id="hqid">94</div>
<div id="divBuy" class="consume-wrapper clearfix">
    <a href="javascript:;" id="consume-now" class="Det_Shopbut nowget" goods_id="{$goods['details']['id']}" style="font-size: 22px;text-decoration: none">立即1元抢购</a>
    <a href="javascript:;" id="consume-addcar" class="Det_Cart oneget" goods_id="{$goods['details']['id']}" style="font-size: 22px;text-decoration: none">加入购物车</a>
</div>
                            
    
<div class="about-tips clearfix" style="margin-top:18px;">
    <ul class="f-inner clearfix">
        <li class="z-beginning">三大服务保证：</li>
        <li><i class="ng-xq-bg t1"></i>100%公平公正</li>
        <li class="z-lines"><b></b></li>
        <li><i class="ng-xq-bg t2"></i>100%正品保证</li>
        <li class="z-lines"><b></b></li>
        <li><i class="ng-xq-bg t3"></i>全国免费配送</li>
    </ul>
</div>                                                  <div class="advert-wrapper">
                            <ul class="select-wrapper">
                                <li class="gray9">怎么玩儿<i class="ng-xq-bg"></i></li>
                            </ul>
                            <div id="div_advertinner" class="advert-inner clearfix">
                                <div class="advert-list01 advert-m">
                                    <div class="ad-icon01 ng-xq-bg"></div>
                                    <p class="ad-title">选择商品</p>
                                    <p class="ad-info">
                                        每个商品规定总需<br>
                                        参与人次(1人次=1元)
                                    </p>
                                    <div class="arrow ng-xq-bg"></div>
                                </div>
                                <div class="advert-list02 advert-m">
                                    <div class="ad-icon02 ng-xq-bg"></div>
                                    <p class="ad-title">支付1元</p>
                                    <p class="ad-info">
                                        参与人次越多<br>
                                        获得机率越大
                                    </p>
                                    <div class="arrow ng-xq-bg"></div>
                                </div>
                                <div class="advert-list03 advert-m">
                                    <div class="ad-icon03 ng-xq-bg"></div>
                                    <p class="ad-title">抽出幸运获得者</p>
                                    <p class="ad-info">
                                        所有人次售完后根据计算规则<br>
                                        抽出一位幸运获得者
                                    </p>
                                </div>
                            </div>
                        </div>
                                            </div>
                
                </div>
                

                <!--揭晓倒计时-->

                <!--右侧：抢购记录-->

                <div class="ng-goods-buy">
                    <!--进行中状态-->
                        <div class="ng-buy-list">
                            <div class="open_get_info">上期获奖者</div>
                            <dl class="dl1">
                                <dt>
                                    <a href="#"><img src="__ROOT__/{$goods['record']['uphoto']}" alt="{$goods['record']['username']}" /></a>
                                </dt>
                                <dd>
                                    <p>恭喜玩家<a href="#" title="恭喜玩家{$goods['record']['username']}获得{$goods['record']['shopname']}" class="a_color">{$goods['record']['username']}</a><br/>获得{$goods['record']['shopname']}</p>
                                </dd>
                            </dl>
                            
                            <dl class="dl2">
                                <dd>夺宝冠军：<a href="#"  class="a_color">{$goods['record']['username']}</a></dd>
                                <dd>参与夺宝：{$goods['record']['gonumber']}次</dd>
                                <dd>揭晓时间：<PHP>echo date('Y-m-d H:i:s',$goods['record']['q_end_time'])</PHP></dd>
                                <dd>夺宝时间：<PHP>echo date('Y-m-d H:i:s',$goods['record']['time'])</PHP></dd>
                                <dd>幸运号码：{$goods['record']['huode']}</dd>
                            </dl>

                        </div>
                    

                    <!--结束状态-->
                    
                </div>
                <!--清除浮动-->
                <div class="clear"></div>
            </div>
        </div>
    
            <script>
                var si=$(".jcarousel-clip label").size();
                var label=si*55;
                $(".jcarousel-clip p").css({width:label,left:"0"});
                if(label>395){
                    $(".jcarousel-prev,.jcarousel-next").show();
                }else{
                    $(".jcarousel-prev,.jcarousel-next").hide();
                }
                $(".jcarousel-prev").click(function(){
                    var le=$(".jcarousel-clip p").css("left");
                    var le2=le.replace(/px/,"");
                    if(le!='0px'){
                        $(".jcarousel-clip p").css({left:le2*1+55});
                    }                       
                })
                $(".jcarousel-next").click(function(){
                    var le=$(".jcarousel-clip p").css("left");
                    var le2=le.replace(/px/,"");
                    var max_next=-(si-7)*55+"px";
                    if(le!=max_next){                       
                        $(".jcarousel-clip p").css({left:le2*1-55});
                    }
                })
            </script>           
            
</div>

        
<!-- 商品信息导航 -->
<div class="show_content" style="margin-top:10px;">
<div class="ProductTabNav">
    <div id="divProductNav" class="DetailsT_Tit">
        <div class="DetailsT_TitP">
            <ul>
                <li class="Product_DetT DetailsTCur"><span class="DetailsTCur">商品详情</span></li>
                <li id="liUserBuyAll" class="All_RecordT"><span class="">夺宝记录</span></li>
                <!--<li class="Single_ConT"><span class="">晒单评论</span></li>-->
            </ul>
        </div>
    </div>
</div>

<!--补丁3.1.6_b.0.1-->
<div id="divContent" class="Product_Content">
    <!-- 商品内容 -->
    <div class="Product_Con">
        {$goods['details']['content']}
    </div>
    <!-- 商品内容 -->
    
    <!-- 购买记录20条 -->
    <div id="bitem" class="AllRecordCon">
        <iframe id="iframea_bitem" g_src="{:U('Home/Yungo/goRecord',array('gid'=>$goods['details']['id']))}" style="width:978px; border:none;height:300px;" frameborder="0" scrolling="no"></iframe>        
    </div>  
   <!-- /购买记录20条 -->
    
    <!-- 晒单 -->
    <div id="divPost" class="Single_Content">
        <iframe id="iframea_divPost" g_src="" style="width:978px; border:none;height:100%" frameborder="0" scrolling="no"></iframe>
    </div>
    <!-- 晒单 --> 
</div>
<!--补丁3.1.6_b.0.1-->
</div>

<script type="text/javascript">
<!--补丁3.1.6_b.0.2-->
function set_iframe_height(fid,did,height){ 
    $("#"+fid).css("height",height);    
}

$(function(){
    $("#ulRecordTab li").click(function(){
        var add=$("#ulRecordTab li").index(this);
        $("#ulRecordTab li").removeClass("Record_titCur").eq(add).addClass("Record_titCur");
        $(".Pro_Record .hide").hide().eq(add).show();
    });
    
    var DetailsT_TitP = $(".DetailsT_TitP ul li");
    var divContent    = $("#divContent div");   
    DetailsT_TitP.click(function(){
        var index = $(this).index();
            DetailsT_TitP.removeClass("DetailsTCur").eq(index).addClass("DetailsTCur");
    
            var iframe = divContent.hide().eq(index).find("iframe");
            if (typeof(iframe.attr("g_src")) != "undefined") {
                 iframe.attr("src",iframe.attr("g_src"));
                 iframe.removeAttr("g_src");
            }
            divContent.hide().eq(index).show();
    });
    <!--补丁3.1.6_b.0.2-->
    
    
    <!--补丁查看更多-->
    $("#btnUserBuyMore").click(function(){
        $("#liUserBuyAll").click();
        $("html,body").animate({scrollTop:941},1500);
    });
    $(window).scroll(function(){
        if($(window).scrollTop()>=941){
            $("#divProductNav").addClass("nav-fixed");
        }else if($(window).scrollTop()<941){
            $("#divProductNav").removeClass("nav-fixed");
        }
    });
})
var shopinfo={'shopid':94,'money':1.00,'shenyu':5287};
<!--补丁查看更多-->
    
$(function(){
    function baifenshua(aa,n){
    n = n || 2;
    return ( Math.round( aa * Math.pow( 10, n + 2 ) ) / Math.pow( 10, n ) ).toFixed( n ) + '%';
}
    var shopnum = $("#num_dig");
        var ten_per = Math.floor(parseInt(5288)) || 1;
    var max_num = (ten_per > parseInt(shopinfo['shenyu'])) ? parseInt(shopinfo['shenyu']) : ten_per;
    shopnum.keyup(function(){
        if(shopnum.val()>=max_num){
            shopnum.val(max_num);
        }
        var numshop=shopnum.val();
        if(numshop==5288){
            var baifenbi='100%';
        }else{
            var showbaifen=numshop/5288;
            var baifenbi=baifenshua(showbaifen,2);
        }
        $("#chance").html("<span style='color:red'>获得机率"+baifenbi+"</span>");
    });
    
    $("#shopadd").click(function(){
        var shopnum = $("#num_dig");
            var resshopnump='';
            var ten_per = Math.floor(parseInt(5288)) || 1;
            var max_num = (ten_per > parseInt(shopinfo['shenyu'])) ? parseInt(shopinfo['shenyu']) : ten_per;
            var num = parseInt(shopnum.val());
            if(num >= max_num){
                shopnum.val(max_num);
                resshopnump = max_num;
            }else{
                resshopnump=parseInt(shopnum.val())+1;
                shopnum.val(resshopnump);
            }
            if(resshopnump==5288){
                var baifenbi='100%';
            }else{
                var showbaifen=resshopnump/5288;
                var baifenbi=baifenshua(showbaifen,2);
            }
            $("#chance").html("<span style='color:red'>获得机率"+baifenbi+"</span>");
    });
    
    
    $("#shopsub").click(function(){
        var shopnum = $("#num_dig");
        var num = parseInt(shopnum.val());
        if(num<2){
            shopnum.val(1);         
        }else{
            shopnum.val(parseInt(shopnum.val())-1);
        }
        var shopnums=parseInt(shopnum.val());
        if(shopnums==5288){
                var baifenbi='100%';
            }else{
                var showbaifen=shopnums/5288;
                var baifenbi=baifenshua(showbaifen,2);
            }
            $("#chance").html("<span style='color:red'>获得机率"+baifenbi+"</span>");
    });
});


$(function(){
$(".Det_Cart").click(function(){ 
    //添加到购物车动画
    var src=$("#zoom1 img").attr('src');  
    var $shadow = $('<img id="cart_dh" style="display: none; border:1px solid #aaa; z-index: 99999;" width="400" height="400" src="'+src+'" />').prependTo("body"); 
    var $img = $(".mousetrap").first("img");
    $shadow.css({ 
       'width' : $img.css('width'), 
       'height': $img.css('height'),
       'position' : 'absolute',      
       'top' : $img.offset().top,
       'left' : $img.offset().left, 
       'opacity' :1    
    }).show();
    var $cart =$("#btnMyCart");
    var numdig=$(".num_dig").val();
    $shadow.animate({   
        width: 1, 
        height: 1, 
        top: $cart.offset().top, 
        left: $cart.offset().left,
        opacity: 0
    },500,function(){
        Cartcookie(false);
    });     
});
/*
    $(".Det_Shopbut").click(function(){ 
        Cartcookie(true);
    }); 
    */
});

 
</script> 
<script type="text/javascript">             
$(document).ready(function(){
    //加入清单
    $('.oneget').click(function(){
        var _this = $(this);
        var goods_id = parseInt(_this.attr('goods_id'));
        $.ajax({
            type : 'POST',
            url : '/index.php?m=Go&c=Ajax&a=addShopCart&gid='+goods_id+'&num='+1,
            success : function(res){
                var res = $.parseJSON(res);
                if (res['code'] == 0) {
                    if(res['num'] > 0){
                $('.m-other span').text(res['num']);
                    }
                }
            }
        });
    });  
    //立即夺宝
    $('.nowget').click(function(){
        var _this = $(this);
        var goods_id = parseInt(_this.attr('goods_id'));
        $.ajax({
            type : 'POST',
            url : '/index.php?m=Go&c=Ajax&a=addShopCart&gid='+goods_id+'&num='+1,
            success : function(res){
                var res = $.parseJSON(res);
                if (res['code'] == 0) {
                    if(res['num'] > 0){
                        location.href = "{:U('Home/Yungo/index',array('to'=>1))}"
                    }
                }
            }
        });
    });
})
</script>
<style>.yFootSupport_in dd a{height:30px;line-height:30px;}</style>
<script type="text/javascript">
  function current(){ 
  var d=new Date(),str=''; 
  str +=d.getMonth()+1+'月'; //获取当前月份（0——11） 
  str +=d.getDate()+'日&nbsp;&nbsp;'; 
  str +=d.getHours()+':'; 
  str +=d.getMinutes()+':'; 
  str +=d.getSeconds()+''; 
  return str; } 
  setInterval(function(){$("#nowTime").html(current)},1000); 
</script>
  <style>
  .header-right{float: right;margin-right: 5px;margin-top: 20px;}
  .header-right a{
      display: block;
      width: 130px;text-align: center;
      height: 42px;line-height: 42px;background:#ff4a00;border-radius: 2px;color: #fff;font-size: 20px;
  }
  </style>




    <script type="text/javascript">
                
                
                
$(document).ready(function(){
    try{  
       if(typeof(eval(pleasereg_initx))=="function"){
            pleasereg_initx();
       }
    }catch(e){
       //alert("not function"); 
    }  
})
</script>

<script>



</script>
</block>